$(document).ready(function () {
    $(".nr-toolbar").toolbar('setFuncs', {
        add: function () {
            var that = this,
                _category = $("._category").val();;

            if (!_category) {
                return sy.tip('请选择叶子分组!','error');
            }
            var url = sy.url({
                a: 'add',
                param: {
                    _category: _category
                }
            });
            var opt = $.extend({
                title: '新增',
                cancel: true,
                button: [{
                    name: '保存',
                    class: "btn-outline-primary",
                    submit: true,
                    close: true,
                    toolbar: that,
                    click: function (e, iframe) {

                    },
                    callback: function () {

                    }
                },]
            },
                {}
            );

            sy.open(url, opt);
        },
    })
});